home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5351 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: lrz-muenchen.de!news
  2. From: watzka@stat.uni-muenchen.de (Kurt Watzka)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Limit on #bytes inside of struct?
  5. Date: 12 Feb 1996 11:17:31 GMT
  6. Organization: Leibniz-Rechenzentrum, Muenchen (Germany)
  7. Distribution: world
  8. Message-ID: <4fn7kb$ii2@sparcserver.lrz-muenchen.de>
  9. References: <4feg1d$d4g@cville-srv.wam.umd.edu> <4ffg6b$ivd@sparcserver.lrz-muenchen.de> <4ffohq$1gb@mordred.gatech.edu> <4ffun7$1l4l@cymbal.aix.calpoly.edu> <311F15D8.78D1@zess.uni-siegen.de>
  10. NNTP-Posting-Host: sun2.lrz-muenchen.de
  11.  
  12. Markus Becker <becker@zess.uni-siegen.de> writes:
  13.  
  14. >Dan Stubbs wrote:
  15. >> Here is a specific program to test the above suggestions.
  16.  
  17. >No it isn't, see below.
  18.  
  19. >>    typedef struct {
  20. >>       int the_array[50000];
  21. >>    } struct_type;
  22. >> 
  23.  
  24. >This way, you don't put the 50K numbers in the struct, but only
  25. >a pointer to them. Should be at most 4 bytes.
  26.  
  27. If sizeof(struct_type) is sizeof(int *) in your implementation, 
  28. there is something seriously wrong with that implementation. An
  29. array of int is _not_ a pointer to int. The size of a struct
  30. that contains an array of 50000 ints is greater than or equal
  31. to 50000 times the size of an int.
  32.  
  33. Kurt
  34. --
  35. | Kurt Watzka                             Phone : +49-89-2180-6254
  36. | watzka@stat.uni-muenchen.de
  37. | ua302aa@sunmail.lrz-muenchen.de
  38.